Backport of upstream PR #1055: traced error err into#3
Closed
BatmanAoD wants to merge 2 commits into
Closed
Conversation
acbbf51 to
635c708
Compare
a2cd246 to
979cc0e
Compare
BatmanAoD
commented
Jun 17, 2026
Comment on lines
+3
to
+4
| # The '0.775' series is compatible with tracing-core 0.1, but is only published privately and used by Rigetti. | ||
| version = "0.775.0" |
Collaborator
Author
There was a problem hiding this comment.
This is a "breaking" change, and inconsistent with the upstream convention of versioning all the tracing crates together. But tracing-error is not a transitive dependency anywhere; we only depend directly on it, so the version number doesn't need to match across dependencies outside of our control. And by using 775 as the minor version, we make it very unlikely our version numbers will ever collide with upstream version numbers, while also having a stable value that is familiar to Rigetti employees so that we can easily recognize it as coming from our fork.
## Motivation
Right now TracedError is pretty much incompatible with enum heavy error
handling implementations. The way its currently designed you'd have to make
sure that each leaf error independently is wrapped in a `TracedError` so that
all sources end up capturing a SpanTrace.
## Solution
To resolve this I've added a `map` method for transforming the inner type of a
TracedError while preserving the existing SpanTrace. This is still a bit
cumbersome, where before you'd be able to write `result.map_err(|source|
MyError { source, some_context })` now you'll have to write
`result.map_err(|source| source.map(|source| MyError { source, some_context
}))`. To fix this we should probably eventually add an extension trait on
`Result` but I want to experiment with that half of the change in `zebra`
before committing to an API, since it can easily be done out of tree.
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
979cc0e to
ade769c
Compare
Collaborator
Author
|
We can't use the same branch for upstream PRs and "local" PRs. |
Collaborator
Author
|
Replaced by #5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"local" version of tokio-rs#3555